//
//  PaddleHitEffect.m
//  BeatPong
//
//  Created by Gabriel Lumbi on 12-09-12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "PaddleHitEffect.h"

@implementation PaddleHitEffect

#pragma mark -
#pragma mark Life Cycle

-(id) init
{
    if(self = [super init])
    {
        maxRadius = 60.f;
    }
    return self;
}

#pragma mark -
#pragma mark Draw

-(void) draw
{
    [super draw];
    
    if(!self.over){
        float percent = (log1pf(currentTime/lifespan*100))/ (log1pf(lifespan*100)+2);
        float radius = maxRadius * percent;
        ccDrawColor4F(1, 0, 1, 1);
        ccDrawCircle([self convertToNodeSpace:self.position],
                     radius,
                     0,
                     30,
                     NO);
    }
}

@end